home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
005
/
bills.arc
/
BILLS.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1985-03-16
|
2KB
|
75 lines
program bills (input,output);
(* written by Kenneth Lenger
7263 E. 70th Ave.
Commerce City, CO 80022
Compuserv I.D. 70137,2051
March 17, 1985 *)
const
slash = '/';
type
date_string = string[10];
var
bill_file : text;
pay_date : date_string;
notes : string[70];
today : date_string;
modfd_date : date_string;
function Date: Date_string;
type
regpack = record
ax,bx,cx,dx,bp,si,ds,es,flags: integer;
end;
var
recpack: regpack; {record for MsDos call}
month,day: array[1..2] of char;
year: string[4];
dx,cx: integer;
begin
with recpack do
begin
ax := $2a shl 8;
end;
MsDos(recpack); { call function }
with recpack do
begin
str(cx,year); {convert to string}
day[1] := chr(((dx mod 256) div 10) + 48); { " }
day[2] := chr(((dx mod 256) mod 10) + 48);
dx := dx shr 8;
month[1] := chr((dx div 10) + 48); { " }
month[2] := chr((dx mod 10) + 48);
end;
date := month + slash + day + slash + year;
end;
function change_date(pay_date:date_string):date_string;
var
year : string[4];
month,day : string[2];
begin
year := copy(pay_date,7,4);
month := copy(pay_date,1,2);
day := copy(pay_date,4,2);
change_date := year + slash + month + slash + day;
end;
begin (* main program *)
assign (bill_file,'bills.dat');
reset(bill_file);
today := change_date(date);
writeln;
writeln('Today is ', date,'. Things to do:');
writeln('Date Do this:');
writeln('---------- --------');
while not eof(bill_file) do
begin
readln(bill_file,pay_date,notes);
modfd_date := change_date(pay_date);
if modfd_date <= today then
writeln (pay_date,notes);
end;
writeln('End of Things to do.')
end.